<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="front/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="front/css/public.css" media="all" />
</head>
<body>
<script type="text/javascript" src="common/nav.js"></script>
</body>

<script type="text/javascript" src="front/layui/layui.js"></script>
<script type="text/javascript" src="/news/front/js/api.js"></script>
<script type="text/javascript" src="front/js/common.js"></script>
</html>

<script>
    var param = getRequest();

    layui.use(['layer','element'],function(){
        var element = layui.element;
        var $ = layui.jquery;
        getArticle(param.id);
        function getArticle(id){
            $.ajax({
                url:API_BASE_URL+'/article?method=getArticleById&articleId='+ id,
                method:"GET",
                contentType: "application/json;charset=utf-8",
                dataType: "json",
                success(res){
                    console.log(res.code)
                    if (res.code == 200){
                        $(".title").html(res.data.title)
                        $(".author").html(res.data.author)
                        $(".text").html(res.data.text)
                    }
                }
            })
        }
    })
</script>